package com.timberwood.controller;

import java.util.List;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.timberwood.model.dao.NewDAO;
import com.timberwood.model.entity.News;

public class NewAction extends ActionSupport {
	private static final long serialVersionUID = 1L;

	
	private NewDAO newcontroller;
	public NewAction() {
		newcontroller=new NewDAO();
	}
	
	//load list news by newtype
	private List<News> listnew;
	public List<News> getListnew() {
		return listnew;
	}
	
	String typeNew;
	public String getTypeNew() {
		return typeNew;
	}
	public String getNewByType(){
		typeNew=ServletActionContext.getRequest().getParameter("type");
		listnew=newcontroller.sleNewByType(typeNew);
		return SUCCESS;
	}
	
	
}
